package STUDENT.TranMinhVu.OOPS.ArrayExercises.Exercise2;

public class Exercise2 {
	public static int Average(int[] array){
		int sum = 0;
	    for (int i = 0; i < array.length; i++) {
	     	sum += array[i];
	    }
	    return sum/array.length;
	}
	public static double Average(double[] array){
		double sum = 0;
	    for (int i = 0; i < array.length; i++) {
	     	sum += array[i];
	    }
	    return sum/array.length;
	}
	public static void main(String[] args) {
		 Exercise2 obj = new Exercise2();
		 int[] array1= {1,2,3,4,5,6};
		 double[] array2 = {6.0,4.4,1.9,2.9,3.4,3.5};
		 System.out.println(obj.Average(array1));
		 System.out.println(obj.Average(array2));	
	}
}
